<template>
  <div class="attention" :style="{marginBottom:isAndroid?'100px':'128px'}">
    <div style="text-align: center">关注列表</div>

    <div class="push-list">
      <Push v-for="push in pushListk" :push="push"
            :is-like="push.isLike"
            :key="push.id+'push'"></Push>

    </div>


  </div>
</template>

<script>
import Push from "@/components/Push";
import {mapState} from "vuex";

export default {
  name: "Attention",
  components: {Push},
  computed: {
    ...mapState(['likeList', 'pushList']),
    pushListk() {
      let newPushList = [];
      this.pushList.map((item => {
        let like = this.likeList.some(value => value === item.id)
        newPushList.push(Object.assign({}, item, {isLike: like}))
      }))
      return newPushList;
    },
    isAndroid() {
      let u = navigator.userAgent;
      //android终端
      return u.indexOf('Android') > -1 || u.indexOf('Adr') > -1;
    },
  },
  data() {
    return {
      error: false,
      loading: false,
    }
  }
}
</script>

<style lang="less">

.attention {

}

</style>